#include <opencv2/opencv.hpp>
#include <iostream>
#include <filesystem>
#include <vector>
#include "log/log.h"
#include "video_source.h"

namespace fs = std::filesystem;

int main(int argc, char **argv) {
  if (argc != 2) {
    LOGE("please input image path.");
    return -1;
  }

  alg::VideoSource *video_source = new alg::VideoSource(argv[1],
                                                        ALG_BIG_FRAME_WIDTH,
                                                        ALG_BIG_FRAME_HEIGHT,
                                                        ALG_SMALL_FRAME_WIDTH,
                                                        ALG_SMALL_FRAME_HEIGHT);
  int32_t total_frame = video_source->GetTotalFrameCount();
  VZ_HLP_ALG_Frame bigFrame, smallFrame;

  for (int32_t i = 0; i < total_frame; i++) {
    video_source->GetYuvFromFile(bigFrame, smallFrame);
//    cv::waitKey(1000); // 延时 1 秒
  }
  cv::destroyAllWindows();

  return 0;
}
